package com.zlt.dao.Impl;

import com.zlt.dao.RoleDao;
import com.zlt.entity.Role;
import com.zlt.util.SqlUtil;

import java.util.List;

/**
 * @author wbh
 * @version 1.0
 * @description: TODO
 * @date 2022/8/11 19:42
 */
public class RoleDaoImpl implements RoleDao {

    @Override
    public int addRole(String uid, Integer rid) {
        String sql = "insert into user_role (uid,rid) values (? , ? )";
        return SqlUtil.update(sql, uid, rid);
    }

    @Override
    public List<Role> selectRole(String uid, long l) {
        return null;
    }

//    @Override
//    public List<Role> selectRole(String uid, Long rid) {
//        String sql = "select role.rid,role.name from user_role left join role on user_role.rid=role.rid where user_role.uid=? and user_role.rid=?";
//        return SqlUtil.select(Role.class, sql, uid, rid);
//    }
}
